<?php
/**
 **首页-统计项目
 */
namespace App\Http\Controllers\Agent;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;

class StatisController extends Controller
{
    public function index(Request $request){
		$kefu = [];
		$path = base_path('storage').'/app/system/kefu.php';
		if(file_exists($path)) {
			$kefu = require_once $path;
		};
		$user = Auth::guard('agent')->user();
		$comm = \App\Models\GuildUserComm::where('gid', $user->gid)->first();
		$onlinetime = (new \App\Service\ApiService())->getOnlineTime(['guild' => $user['gid']]);
		return view('agent.index.statis', compact('kefu', 'comm', 'onlinetime'));
	}
}
